<template>
    
    <div class="goods_cell">
        <div class="img_box">
            <!-- <img src="@/assets/images/goods.png" alt=""> -->
            <nuxt-link :to="`/goods/detail/${info.id}`">
            <li-image :src="getImages(info.logo)" class="img" :is-preview="false" v-if="info.logo" :alt="`${info.name}`" />
            <van-image :src="require('@/assets/images/goods.png')" class="img" lazy-load :alt="`${info.name}`" v-else />
        </nuxt-link>
        </div>
        <nuxt-link :to="`/goods/detail/${info.id}`" class="van-multi-ellipsis--l2 goods_name">{{ info.name }}</nuxt-link>
        <div class="goods_footer">
            <div class="left">
                <div class="price">
                    <span class="num">￥{{ info.price }}</span>
                    <span class="old_num">￥{{ info.sellPrice }}</span>
                </div>
                <div class="total">已预约{{ info.initAppointmentCnt }}人</div>
            </div>
            <div class="add">
                <img src="@/assets/images/add.png" alt="">
            </div>
        </div>
    </div>

</template>
<script>
export default {
    name: 'HospitalGoods',
    props: {
        info: {
            type: Object,
            default: function () {
                return {};
            },
        },
    },
    data() {
        return {

        }
    },
    methods: {
        // 处理图片
        getImages(str) {
            if (!str) {
                return ''
            }
            let arr = str.split(',');
            let _path = arr[0]
            return _path;
        }
    }
}
</script>
<style lang="less" scoped>
@import './hospital_goods.less';
</style>